program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  pelement=^element;
  element=record
    val: integer;
    next: pelement;
  end;

procedure AddStart (var head: pelement; num: Integer);
var
  tmp: pelement;
begin
  tmp:=head;
  New(head);
  head^.next:=tmp;
  head^.val:=num;
end;

procedure AddEnd (var headn: pelement; num: Integer);
var
  current: pelement;
begin
  if (headn<> nil) then
  begin
    current:=headn;
    while(current^.next<>nil) do
      current:=current^.next;
    New(current^.next);
    current^.next^.val:=num;
    current^.next^.next:=nil
  end else begin
    AddStart(headn, num);
  end;
end;

procedure Print(head: pelement);
var
  current: pelement;
begin
  current:=head;
  while(current<>nil) do
  begin
    Write(current^.val, ' ');
    current:=current^.next;
  end;
end;

procedure Move(var head: pelement; n: Integer);
var
  tmp, current, headn: pelement;
  i, num, k: integer;
begin
  headn:=nil;
  current:=head;
  if (n mod 2 =0) then
  begin
    k:=n div 2;
    for i:=1 to k do
      current:=current^.next;
    while (current^.next<>nil) do
    begin
      num:=current^.val;
      AddEnd(headn, num);
      current:=current^.next;
    end;
    num:=current^.val;
    AddEnd(headn, num);
    current:=head;
    for i:=1 to k do
    begin
      num:=current^.val;
      AddEnd(headn, num);
      current:=current^.next;
    end;
    print(headn);
  end;
  if (n mod 2 =1) then
  begin
    k:=n div 2;
    for i:=1 to k+1 do
      current:=current^.next;
    while (current^.next<>nil) do
    begin
      num:=current^.val;
      AddEnd(headn, num);
      current:=current^.next;
    end;
    num:=current^.val;
    AddEnd(headn, num);
    current:=head;
    for i:=1 to k do
      current:=current^.next;
    num:=current^.val;
    AddEnd(headn, num);
    current:=head;
    for i:=1 to k do
    begin
      num:=current^.val;
      AddEnd(headn, num);
      current:=current^.next;
    end;
    print(headn);
  end;
end;

var
  i, n, num, a, b: Integer;
  fin: TextFile;
  head: pelement;
begin
  AssignFile(fin, 'input.txt');
  Reset(fin);
  head:=nil;
  Readln(fin, n);
  for i:= 1 to n do
  begin
    read (fin, num);
    AddStart(head, num);
  end;
  Move(head, n);
  CloseFile(fin);
  Readln;
end.